﻿using RongCloudSms.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Zop;

namespace RongCloudSms.Service
{
    public interface IRongCloudService
    {
        /// <summary>
        /// 保存消息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        Task Save(RongCloudModel model);
        /// <summary>
        /// 获取所有群组消息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<(List<RongCloudModel> list, int count)> Get(string id,int userid, long timestamp, int pagecount);
        /// <summary>
        /// 验签
        /// </summary>
        /// <param name="signTimestamp"></param>
        /// <param name="nonce"></param>
        /// <param name="signature"></param>
        /// <returns></returns>
        Task<bool> Check(string signTimestamp, string nonce, string signature);

        /// <summary>
        /// 获取融云token
        /// </summary>
        /// <param name="uid"></param>
        /// <param name="username"></param>
        /// <returns></returns>
        Task<Result> GetToken(int uid, string username);
        /// <summary>
        /// 创建群组
        /// </summary>
        /// <param name="aduserid"></param>
        /// <param name="userid"></param>
        /// <param name="groupid"></param>
        /// <param name="groupname"></param>
        /// <returns></returns>
        Task<Result> CreateGroup(int aduserid, int userid, string groupid, string groupname);
        /// <summary>
        /// 获取群主里所有用户
        /// </summary>
        /// <param name="groupid"></param>
        /// <returns></returns>
        Task<List<int>> GetUserAll(string groupid);
    }
}
